package com.wzy.web.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * PmProcess entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "pm_process", catalog = "saozhe")
public class PmProcess implements java.io.Serializable {

	// Fields

	private Integer processId;
	private String processName;
	private String processStartDate;
	private String processEndDate;
	private String processDetail;
	private String dateTime;
	private PmProject pmProject;
	private Set<PmActor> pmActors = new HashSet<PmActor>(0);

	// Constructors

	/** default constructor */
	public PmProcess() {
	}

	/** minimal constructor */
	public PmProcess(String processName, String processStartDate,
			String processEndDate, String processDetail, String dateTime) {
		this.processName = processName;
		this.processStartDate = processStartDate;
		this.processEndDate = processEndDate;
		this.processDetail = processDetail;
		this.dateTime = dateTime;
	}

	/** full constructor */
	public PmProcess(String processName, String processStartDate,
			String processEndDate, String processDetail, String dateTime,
			Set<PmActor> pmActors) {
		this.processName = processName;
		this.processStartDate = processStartDate;
		this.processEndDate = processEndDate;
		this.processDetail = processDetail;
		this.dateTime = dateTime;
		this.pmActors = pmActors;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "processId", unique = true, nullable = false)
	public Integer getProcessId() {
		return this.processId;
	}

	public void setProcessId(Integer processId) {
		this.processId = processId;
	}

	@Column(name = "processName", nullable = false, length = 100)
	public String getProcessName() {
		return this.processName;
	}

	public void setProcessName(String processName) {
		this.processName = processName;
	}

	@Column(name = "processStartDate", nullable = false, length = 20)
	public String getProcessStartDate() {
		return this.processStartDate;
	}

	public void setProcessStartDate(String processStartDate) {
		this.processStartDate = processStartDate;
	}

	@Column(name = "processEndDate", nullable = false, length = 20)
	public String getProcessEndDate() {
		return this.processEndDate;
	}

	public void setProcessEndDate(String processEndDate) {
		this.processEndDate = processEndDate;
	}

	@Column(name = "processDetail", nullable = false, length = 65535)
	public String getProcessDetail() {
		return this.processDetail;
	}

	public void setProcessDetail(String processDetail) {
		this.processDetail = processDetail;
	}

	@Column(name = "dateTime", nullable = false, length = 20)
	public String getDateTime() {
		return this.dateTime;
	}

	public void setDateTime(String dateTime) {
		this.dateTime = dateTime;
	}
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "projectId", nullable = false)
	public PmProject getPmProject() {
		return pmProject;
	}

	public void setPmProject(PmProject pmProject) {
		this.pmProject = pmProject;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "pmProcess")
	public Set<PmActor> getPmActors() {
		return this.pmActors;
	}

	public void setPmActors(Set<PmActor> pmActors) {
		this.pmActors = pmActors;
	}

}